import urllib.request

url = 'http://www.baidu.com'

response = urllib.request.urlopen(url)
# content = response.read() # 获取网页内容

# 1个类型 6个方法

content = response.read() # 获取网页内容 按字节读取
content = response.readlines() # 按行读取

